package ro.gillardon.commons.logger;

import org.apache.log4j.Level;
import org.apache.log4j.Logger;

/**
 * The Class BTPLogger.
 */
public final class BTPLogger {

  /**
   * Prohibit instantiation of BTP logger.
   */
  private BTPLogger() {
    // Prohibit instantiation of BTP logger.
  }

  /**
   * Debug.
   *
   * @param log the log
   * @param message the message
   */
  public static void debug(final Logger log, final Object message) {
    if (log.isDebugEnabled()) {
      log.debug(message);
    }
  }

  /**
   * Error.
   *
   * @param log the log
   * @param message the message
   */
  public static void error(final Logger log, final Object message) {
    if (log.isEnabledFor(Level.ERROR)) {
      log.error(message);
    }
  }

  /**
   * Info.
   *
   * @param log the log
   * @param message the message
   */
  public static void info(final Logger log, final Object message) {
    if (log.isEnabledFor(Level.INFO)) {
      log.info(message);
    }
  }

  /**
   * Trace.
   *
   * @param log the log
   * @param message the message
   */
  public static void trace(final Logger log, final Object message) {
    if (log.isEnabledFor(Level.TRACE)) {
      log.trace(message);
    }
  }

  /**
   * Warn.
   *
   * @param log the log
   * @param message the message
   */
  public static void warn(final Logger log, final Object message) {
    if (log.isEnabledFor(Level.WARN)) {
      log.warn(message);
    }
  }

  /**
   * Fatal.
   *
   * @param log the log
   * @param message the message
   */
  public static void fatal(final Logger log, final Object message) {
    if (log.isEnabledFor(Level.FATAL)) {
      log.fatal(message);

    }
  }
}
